<%@ page language="java" %>
<%@ page import="com.scalar.chiptrack.users.User,
                 com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.commons.Constants,com.scalar.chiptrack.users.User"%>
<%@ page import="com.scalar.chiptrack.users.Functionality"%>

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/jsp/admin/config_setup.jsp"/>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR>
</HEAD>
<SCRIPT>
function saveConfig()
{
    document.configForm.action = '<%=chipTracContext%>/chipTracConfig?action=save';
    document.configForm.submit();
}
</SCRIPT>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<!-- Top Header Start-->
<%@include file="/jsp/includes/header.jsp"  %>
<!-- Top Header End-->
  
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
    <TR>
        <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
            <!-- Side Navigation start -->
            <%@ include file="/jsp/admin/admin_menu.jsp" %>
            <!-- end of the side navigations -->
        </TD>
        <TD bgcolor="#ffffff"><IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
        <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
        <TD valign="top" width="100%">
            <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
            <BR>
            <center><span class="NArialW">Configuration Setup</span></center>
            <!-- from here your body starts -->
            <table border='0' width='80%' align='right' class='NArialL' cellspacing='8'>
                <tr>
                    <td colspan='3'><IMG height=20 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></td>
                </tr>
                <tr><td colspan='3'><chiptrack:info styleClass='NArialL'/></td></tr>
                <tr><td colspan='3'><chiptrack:errors styleClass='NArialL'/></td></tr>
                <%
                    if ( !user.isActionAllowed( Functionality.CONFIG_SETUP, User.USER_ACTION_MODIFY ) )
                    {
                %>
                <tr>
                    <td colspan=7 align='left'><font class='NArialS'><font color='blue'><b><%=Constants.NO_MODIFY_RIGHTS%></font></td>
                </tr>
                <%  }  %>
                <tr><td colspan='3'><IMG height=20 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></td></tr>
                <form name='configForm' method='post'>
                <tr>
                    <td width="30%" bgcolor='#FDF5E6' align='left' nowrap>Mail Host:</td>
                    <td width="60%" align='left' nowrap class='NArialS'>
                        <input type='text' name='mailHost' value='<%=ConfigManager.getMailHost()%>' size='30' maxlength='300' class='txfield'>&nbsp;&nbsp;<font class='NArialS'>(IP address or host name)</font>
                    </td>
                    <td width="10%" align='left' nowrap>&nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor='#DEE1E2' align='left' nowrap>Job Cleanup Period:</td>
                    <td align='left' nowrap>
                        <input type='text' name='jobCleanupPeriod' value='<%=ConfigManager.getJobRunnerCleanupPeriod()%>' size='6' maxlength='6' class='txfield'>&nbsp;&nbsp;<font class='NArialS'>sec</font>
                    </td>
                    <td align='left' nowrap>&nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor='#FDF5E6' align='left' nowrap>Job Polling Period:</td>
                    <td align='left' nowrap>
                        <input type='text' name='jobPollingPeriod' value='<%=ConfigManager.getJobPollingPeriod()%>' size='6' maxlength='6' class='txfield'>&nbsp;&nbsp;<font class='NArialS'>sec</font>
                    </td>
                    <td align='left' nowrap>&nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor='#DEE1E2' align='left' nowrap>Alarm Monitor Period:</td>
                    <td align='left' nowrap>
                        <input type='text' name='alarmMonitorPeriod' value='<%=ConfigManager.getAlarmMonitorRefreshInterval()%>' size='6' maxlength='6' class='txfield'>&nbsp;&nbsp;<font class='NArialS'>sec</font>
                    </td>
                    <td align='left' nowrap>&nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor='#FDF5E6' align='left' >Remind Packing Slip generation before:</td>
                    <td align='left' nowrap>
                        <input type='text' name='packingSlipReminderDays' value='<%=ConfigManager.getPackingSlipReminderDays()%>' size='6' maxlength='6' class='txfield'>&nbsp;&nbsp;<font class='NArialS'>days</font>
                    </td>
                    <td align='left' nowrap>&nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor='#DEE1E2' align='left' nowrap>Administrator Email:</td>
                    <td align='left' nowrap class='NArialS'>
                        <input type='text' name='adminEmail' value='<%=ConfigManager.getScalarAdminEmail()%>' size='45' maxlength='300' class='txfield'>
                    </td>
                    <td align='left' nowrap>&nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor='#FDF5E6' align='left' >From Email Category:</td>
                    <td align='left' nowrap>
                        <select class='txfield' name="fromEmailCategory">
                            <option value="<%=Constants.FROM_EMAIL_CATEGORY_ADMIN%>" <%=Constants.FROM_EMAIL_CATEGORY_ADMIN.equalsIgnoreCase(ConfigManager.getFromEmailCategory()) ? "selected" : ""%> ><%=Constants.FROM_EMAIL_CATEGORY_ADMIN%></option>
                            <option value="<%=Constants.FROM_EMAIL_CATEGORY_USER%>" <%=Constants.FROM_EMAIL_CATEGORY_USER.equalsIgnoreCase(ConfigManager.getFromEmailCategory()) ? "selected" : ""%> ><%=Constants.FROM_EMAIL_CATEGORY_USER%></option>
                            <option value="<%=Constants.FROM_EMAIL_CATEGORY_GROUP%>" <%=Constants.FROM_EMAIL_CATEGORY_GROUP.equalsIgnoreCase(ConfigManager.getFromEmailCategory()) ? "selected" : ""%> ><%=Constants.FROM_EMAIL_CATEGORY_GROUP%></option>
                        </select>
                    </td>
                    <td align='left' nowrap>&nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor='#DEE1E2' align='left' >Packing Slip From Email:</td>
                    <td align='left' nowrap>
                        <input type='text' name='packingSlipFromEmail' value='<%=ConfigManager.getPackingSlipFromMailId()%>' size='45' maxlength='300' class='txfield'>
                    </td>
                    <td align='left' nowrap>&nbsp;</td>
                </tr>
                <tr>
                    <td bgcolor='#FDF5E6' align='left' >Sales Order From Email:</td>
                    <td align='left' nowrap>
                        <input type="text" name="salesOrderFromEmail" value="<%=ConfigManager.getSalesOrderFromMailId()%>" size="45" maxlength="300" class="txfield">
                    </td>
                    <td align='left' nowrap>&nbsp;</td>
                </tr>
                <tr><td colspan='3'><IMG height=15 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></td></tr>
                <tr>
                    <td colspan='3' align='center'>
                        <chiptrack:restrictedLink functionality='<%=Functionality.CONFIG_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href="javascript:saveConfig()" onmouseover="window.status='Click here to Save Configuration';return true" onmouseout="window.status='';return true">
                            <img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17">
                        </chiptrack:restrictedLink>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <a href="<%=chipTracContext%>/jsp/admin/admin.jsp"><img border="0" onMouseOver="window.status='Click to Cancel';return true" onMouseout="window.status='';return true" title="Click here to Cancel" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"></a>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </td>
                </tr>
                </form>
            </table>
            <BR><BR><BR>
        </TD>
        <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
    </TR>
</TABLE>
<!-- Footer starts here -->
<%@include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</HTML>
